#include <memory>
#include <iostream>

struct A {
    int x;
};
struct B {
    double y;
};

int main() {
    std::shared_ptr<A> aPtr = std::make_shared<A>();
    aPtr->x = 10;

    // 将 A 类型指针转换为 B 类型指针
    std::shared_ptr<B> bPtr = std::reinterpret_pointer_cast<B>(aPtr);

    std::cout << "Reinterpreted data: " << bPtr->y << std::endl; // 输出可能无意义或导致运行时错误

    return 0;
}